﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using FTTXImportUtility.Utility;

namespace FTTXImportUtility
{
    public delegate void OnRemoveClick(object sender, EventArgs e);//( object sender ,EventArgs e);

    public partial class UCMap : UserControl
    {
        public event OnRemoveClick RemoveClick;

        public UCMap()
        {
            InitializeComponent();
        }

        public UCMap(ICollection sourceCollection, ICollection targetCollection)
        {
            InitializeComponent();
            SetSources(sourceCollection, targetCollection);
        }

        public void SetSources(ICollection sourceCollection, ICollection targetCollection)
        {
            this.comboBoxSource.SetDataSource(sourceCollection);
            this.comboBoxTarget.SetDataSource(targetCollection);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            RemoveClick(this, e);
        }

        public bool CanRemove
        {
            set
            {
                button1.Enabled = value;
            }

            get
            {
                return button1.Enabled;
            }
        }
    }
}
